package com.dxy.common.user;

/**
 * 用户上下文持有器
 */
public class UserContextHolder {

    private static final ThreadLocal<AuthUserSubject> THREAD_LOCAL = new ThreadLocal<>();

    public static void setAuthUserSubject(AuthUserSubject authUserSubject) {
        THREAD_LOCAL.set(authUserSubject);
    }

    public static AuthUserSubject getAuthUserSubject() {
        return THREAD_LOCAL.get();
    }

    public static void remove() {
        THREAD_LOCAL.remove();
    }
}
